package Operation;

import Book.BookDao;
import Book.book;

import java.util.List;
import java.util.Scanner;

public class FindOperation implements IOperation {
    @Override
    public void work() {
        System.out.println ("根据名字找想要的书籍");
        System.out.println ("请输入要查找的书名: ");
        Scanner scanner=new Scanner (System.in);
        String bookName=scanner.next ();
        BookDao bookDao=new BookDao ();
        List<book> bookList=bookDao.selectByName(bookName);
        for (book book:bookList) {
            System.out.println(book);
        }
        System.out.println("查找完毕");
    }
}
